﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace czj_shop.Models.Good
{
    public class UpdateGoodRequest
    {
        //要修改字段
        /// <summary>
        /// 商品名称
        /// </summary>
        [StringLength(maximumLength: 100, MinimumLength = 5, ErrorMessage = "请输入5-100位商品名称长度")]
        [Required(ErrorMessage = "请输入商品名称")]
        public string Name { get; set; }
        /// <summary>
        /// 商品封面图
        /// </summary>
        [Required(ErrorMessage = "请输入商品封面图")]
        public string Pic { get; set; }
        /// <summary>
        /// 商品价格
        /// </summary>
        [Range(0.01, 99999999999, ErrorMessage = "请输入0.01~99999999999的金额")]
        [Required(ErrorMessage = "请输入商品价格")]
        public float Price { get; set; }
        /// <summary>
        /// 商品库存
        /// </summary>
        [Required(ErrorMessage = "请输入商品库存")]
        public int Quantity { get; set; }
        /// <summary>
        /// 商品描述
        /// </summary>
        public string Desciption { get; set; }
        /// <summary>
        /// 商品分类
        /// </summary>
        public int Tid { get; set; }
        /// <summary>
        /// 商品状态（定义1上架 0下架）
        /// </summary>
        public int Status { get; set; }
        //找到这个商品 goodId
        /// <summary>
        /// 商品Id
        /// </summary>
        public int Id { get; set; }
    }

}
